package Graph;
public class Vertex {
	
	public static final String WHITE = "White";
	public static final String GRAY = "Gray";
	public static final String BLACK = "Black";
	
	public Vertex(){
		degree = 0; 
		color = ""; 
		label = "";
		parent = null;
	}
	public Vertex(String new_label){
		 this(0, new_label,"");
	}
	public Vertex(int new_degree, String new_label){
		 this(new_degree,new_label,"");
	}
	
	public Vertex(int new_degree, String new_label,String new_color){
	degree = new_degree;
	color = new_color;
	label = new_label;
	}
	public Vertex(int new_degree, String new_label,String new_color,Vertex p){
		degree = new_degree;
		color = new_color;
		label = new_label;
		parent = p;
	}
	public boolean setLabel(String new_label){
		label = new_label;
		return true;
	}
	
	public boolean setDegree(int new_degree){
		degree = new_degree;
		return true;
	}
	
	public boolean setColor(String string){
		color = string;
		return true;
	}
	
	public String getLabel(){
		return label;
	}
	
	public int getDegree(){
		return degree;
	}
	
	public String getColor(){
		return color;
	}
	
	public boolean equals(Object v){
		boolean retVal = false;
		if (v instanceof Vertex){
			//Graph.print(((Vertex)v).toString() + ", " + ((Vertex)v).getDegree() + ", " +  ((Vertex)v).getColor());
//			if (!((Vertex)v).color.equals(this.color)){
//				retVal = false;
//			}
//			else if (((Vertex)v).degree != this.degree){
//				retVal = false;
//			}
			/*else*/ if (!((Vertex)v).label.equals( this.label)){
				retVal = false;
			}
			else{
				retVal = true;
			}
			//Graph.print(retVal);
			return retVal;
		}
		return false;
	}
	public Vertex getParent() {return parent;}
	public void setParent(Vertex p) {parent = p;}
	
	private int degree;
	private String label,color;
	private Vertex parent;
	
	public String toString(){
//		if (!color.equals("")){
//			return "(" + label + ", " + color + ")";
//		}
		return "(" + label + ")";
	}
	
	


}
